#ifndef UNIT_H
#define UNIT_H
#include <string>

class Unit{
  public:
    unsigned int convertToAmount(unsigned int dimention) const;
    const Unit& getBaseUnit() const;
    std::string toString(const unsigned int amount, const Unit& formatUnit) const;
  
  protected:
    Unit(unsigned int convertToAmountFactor, const char* name, const Unit* next);

  private:
    void convertToDimension(const unsigned int amount, unsigned int& integralDimension, unsigned int& residualDimension) const;
    void formatDimenstion(const unsigned int dimension, std::string& str) const;    
    const Unit& getMaxUnit() const;

    unsigned int m_convertToAmountFactor;
    std::string m_name;
    const Unit* m_NextUnit;
};

#endif
